//
//  UIView+CJTapAction.m
//  CJUIKitDemo
//
//  Created by ciyouzen on 15/11/12.
//  Copyright (c) 2015年 dvlproad. All rights reserved.
//

#import "UIView+CJTapAction.h"
#import <objc/runtime.h>

static NSString *cjTapBlankViewCompleteBlockKey = @"cjTapBlankViewCompleteBlock";

@interface UIView ()

@end


@implementation UIView (CJTapAction)

#pragma mark - runtime
//cjTapBlankViewCompleteBlock
- (void(^)(void))cjTapBlankViewCompleteBlock {
    return objc_getAssociatedObject(self, &cjTapBlankViewCompleteBlockKey);
}

- (void)setCjTapBlankViewCompleteBlock:(void(^)(void))cjTapBlankViewCompleteBlock {
    return objc_setAssociatedObject(self, &cjTapBlankViewCompleteBlockKey, cjTapBlankViewCompleteBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

#pragma mark - Private Event

/** 点击空白区域的事件 */
//- (void)cj_TapBlankViewAction:(UITapGestureRecognizer *)tapGR {
- (void)cj_TapBlankViewAction:(UIButton *)tapButton {
    if (self.cjTapBlankViewCompleteBlock) {
        self.cjTapBlankViewCompleteBlock();
    }
}



@end
